package org.redrider.shop.gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.*;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Inventory implements EntryPoint {
    /**
     * This is the entry point method.
     */
    private class EventHandler implements ClickHandler {

        public void onClick(ClickEvent event) {
            //To change body of implemented methods use File | Settings | File Templates.
        }
    }

    DockPanel mainPanel;
    //MenuBar rootMenu;
    HorizontalPanel hPanel;
    FlexTable flexTable;
    FormPanel itemPanel;


    public void onModuleLoad() {
        mainPanel = new DockPanel();
        hPanel = new HorizontalPanel();
        EventHandler eh = new EventHandler();
        Button doSearch = new Button("Search",eh);
        Button addButton = new Button("Add Inventory Item",eh);
        TextBox searchText = new TextBox();
        hPanel.add(searchText);
        hPanel.add(doSearch);
        hPanel.add(addButton);
        mainPanel.add(hPanel,DockPanel.NORTH);
        // loadMenus(mainPanel);
        flexTable = new FlexTable();
        //mainPanel.add(flexTable ,DockPanel.CENTER);
        RootPanel.get("mainbody").add(mainPanel);
    }

    private void addItem(){
        itemPanel.setAction("/inventoryItem/save");
        itemPanel.setMethod(FormPanel.METHOD_POST);
        
    }

    private void loadTable(FlexTable flexTable) {
    }

    private void loadMenus(DockPanel mainPanel) {
    }
}
